import request from '@/utils/request'
// 树状图
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
// 删除接口
export function deletpartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
// 添加接口
export function addpartments(data) {
  return request({
    url: `/company/department`,
    method: 'POST',
    data
  })
}
// 编辑函数
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 修改ajax
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
